package com.vhall.component.entity.room.enums;

import com.vhall.component.entity.dictionary.enums.BaseEnum;
import lombok.Getter;

/**
 * RefRankEnum-依据评级
 * 1推荐、2谨慎推荐、3中性、4回避、5无评级
 * @author xing.wang
 * @date 2023/8/9
 */
@Getter
public enum RefRankEnum implements BaseEnum {
    RECOMMEND(1, "推荐"),
    PRUDENT_RECOMMEND(2, "谨慎推荐"),
    NEUTRAL(3, "中性"),
    AVOID(4, "回避"),
    NO_RANK(5, "无评级");
    private final Integer value;
    private final String name;
    RefRankEnum(Integer value, String name) {
        this.value = value;
        this.name = name;
    }

    @Override
    public Integer getValue() {
        return value;
    }

    @Override
    public String getName() {
        return name;
    }
    public static String getNameByValue(Integer value) {
        for (RefRankEnum e : RefRankEnum.values()) {
            if (e.getValue().equals(value)) {
                return e.getName();
            }
        }
        return null;
    }

}
